package list;

public class Person implements Comparable<Person>{
	private int age;
	private String name;

	public Person(int age) {
		super();
		this.age = age;
	}
	
	public Person(String name) {
		super();
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "Person [age=" + age + "]";
	}

	@Override
	public int compareTo(Person o) {
		return age - o.age;
	}
	
	

}
